<?php if($categories): ?>
  <?php slot('contents') ?>
    <?php foreach($categories->toArray() as $i => $category): ?>
      <?php if(!$category['picture']) continue; ?>
        <?php if(!(($i + 1) % 5)): ?>
        <div class="door-element" style="margin: 0;" id="door-<?php echo $i ?>">
          <div class="category"></div>
          <div class="category-button"><?php echo $category['Translation'][$sf_user->getCulture()]['name'] ?></div>
          <a href="<?php echo LinkGen::getInstance(LinkGen::PRODUCT_GROUP)->link($category['id']) ?>"><img src="/web/uploads<?php echo $category['picture'] ?>" alt="" /></a>
          <div id="overlay-door-<?php echo $i ?>" class="door-overlay">
            <div class="button-overlay"><?php echo $category['Translation'][$sf_user->getCulture()]['button'] ?></div>
            <a href="<?php echo LinkGen::getInstance(LinkGen::PRODUCT_GROUP)->link($category['id']) ?>"><img src="/web/uploads<?php echo $category['picture_inactive'] ?>" alt="" /></a></div>
        </div>
        <?php else: ?>
        <div class="door-element" id="door-<?php echo $i ?>">
          <div class="category"></div>
          <div class="category-button"><?php echo $category['Translation'][$sf_user->getCulture()]['name'] ?></div>
          <a href="<?php echo LinkGen::getInstance(LinkGen::PRODUCT_GROUP)->link($category['id']) ?>"><img src="/web/uploads<?php echo $category['picture'] ?>" alt="" /></a>
          <div id="overlay-door-<?php echo $i ?>" class="door-overlay">
            <div class="button-overlay"><?php echo $category['Translation'][$sf_user->getCulture()]['button'] ?></div>
            <a href="<?php echo LinkGen::getInstance(LinkGen::PRODUCT_GROUP)->link($category['id']) ?>"><img src="/web/uploads<?php echo $category['picture_inactive'] ?>" alt="" /></a></div>
        </div>
        <?php endif; ?>
     <?php endforeach; ?>
  <?php end_slot() ?>
<?php endif; ?>